import 'dart:convert';

import 'package:flutter_module/beans/base_bean.dart';

class ElementStyle extends BaseBean {
  int maxLength;
  int rule;

  ElementStyle({this.maxLength = 14, this.rule = 1});

  @override
  Map<String, dynamic> toMap() {
    return {"maxLength": maxLength, "rule": rule};
  }

  String toJson() {
    return '{"maxLength": $maxLength,"rule":$rule}';
  }

  factory ElementStyle.fromJson(String json) {
    var map = jsonDecode(json);
    return ElementStyle(maxLength: map["maxLength"], rule: map["rule"]);
  }
}
